<template>
  <div class="app">
    <input v-color="color" type="text" value="请输入我" />
    <button @click="color='plum'">touch me</button>
  </div>
</template>

<script>
export default {
  directives: {
    //自动获取焦点
    //  focus: {
    //     inserted(element) {
    //       element.focus();
    //     },
    //   },
    color: {
      inserted(element, info) {
        element.style.color = info.value;
        console.log(info);
      },
      update(element, info) {
        element.style.color = info.value;
        console.log(info);
      },
    },
  },

  name: "App",
  data() {
    return {color:'skyblue'};
  },
  methods: {},

  computed: {},
};
</script>

<style >
</style>